package info.techgeek.labs.patterns.strategy.Duck2;
public class SortByName implements SortStrategy {

	public int sortingAlgorithm(Object f, Object s) {
		DuckSortable o1 = (DuckSortable) f;
		DuckSortable o2 = (DuckSortable) s;
		
		if (o1.getDuckName().compareTo(o2.getDuckName()) < 0)	return -1;
		if (o1.getDuckName().compareTo(o2.getDuckName()) > 0)	return 1;
		return 0;
	}

}